<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!-- 引入基础系列包 -->
<%@include file="../base/frameBase.jsp" %>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>领航云学堂-注册用户</title>
<link rel="stylesheet" type="text/css" href="${ctx}/static/module/login/css/component.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/module/login/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/module/login/css/demo.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/module/login/css/component.css" />
</head>
<body>
	<div class="container demo-1">
		<div class="content">
			<div id="large-header" class="large-header">
				<canvas id="demo-canvas"></canvas>
				<div class="logo_register_box">
					<h3>欢迎你,新用户</h3>
					<form action="#" name="f" method="post">
						<div class="input_outer">
							<span class="u_user"></span> <input  name="loginName" class="text"
								style="color: #FFFFFF !important" type="text"
								placeholder="请输入账户">
						</div>
						<div class="input_outer">
							<span class="us_phone"></span> <input name="phoneNumber" class="text"
								style="color: #FFFFFF !important; position: absolute; z-index: 100;"
								value=""  placeholder="手机号码">
						</div>
						<div class="input_checkCode">
							<span class="us_checkCode"></span> <input name="checkCodeSms" class="checkInput_text"
								style="color: #FFFFFF !important; position: absolute; z-index: 100;" placeholder="验证码">
						 <span onclick="sendSMS()" class="layui-btn layui-btn-normal layui-btn-radius bt_checkInput_text">发送</span>
						</div>
						<div class="input_outer">    
							<span class="us_uer"></span> <input name="loginPwd" class="text"
								style="color: #FFFFFF !important; position: absolute; z-index: 100;"
								value="" type="password" placeholder="请输入密码">
						</div>
						<div class="mb2">
							<a class="act-but submit" href="javascript:;" onclick="registerSubmit()"
								style="color: #FFFFFF">注册</a>
								<a href="${ctx}/login/loginIndexPage" class="act-register-but bt-submit" href="javascript:;"
								style="color: #FFFFFF">我有帐号，去登录?</a>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div style="text-align:center;">
		<p>
			<a href="http://www.hami6.com" target="_blank">杭州哈密瓜科技有限公司</a><span>  |  </span>
			<a href="http://www.hami6.com" target="_blank">承接小程序 、web系统开发等</a><span>  |  </span>
			<a href="http://www.hami6.com" target="_blank">郑经理</a><span>  |  </span>
			<a href="http://www.hami6.com" target="_blank">15757852723</a>
		</p>
	</div>
</body>
<script src="${ctx}/static/module/login/js/TweenLite.min.js"></script>
<script src="${ctx}/static/module/login/js/EasePack.min.js"></script>
<script src="${ctx}/static/module/login/js/rAF.js"></script>
<script src="${ctx}/static/module/login/js/demo-1.js"></script>
<script>
layui.use('layer', function(){
	var layer=layui.layer;
});

	//注册
	function registerSubmit(){
		debugger;
		var loginName =	$("input[name='loginName']").val(); //用户名
		var phoneNumber = $("input[name='phoneNumber']").val();  //电话号码
		var checkCodeSms = $("input[name='checkCodeSms']").val(); //验证码
		var loginPwd = $("input[name='loginPwd']").val();  //注册密码
		var registerInfo ={};
		$(registerInfo).attr({
			"userName" : loginName
		});
		$(registerInfo).attr({
			"phoneNumber" : phoneNumber
		});
		$(registerInfo).attr({
			"smsCheckCode" : checkCodeSms
		});
		$(registerInfo).attr({
			"password" : loginPwd
		});
		$(registerInfo).attr({
			"checkCodeType" : 1
		});
 		$.ajax({
 			type: "post",
 			url: "${ctx}/loginData/registerUser",
 			dataType: "json",
 			data : JSON.stringify(registerInfo),
 			async:false,
 			contentType: "application/json;charset=utf-8",
 			success: function(result) {
 				debugger;
 				if(result!=null&&result.code=="00000"){
 					layer.msg("注册成功！等待管理员审核中~！");
 				}else{
 					layer.msg(result.message);
 				}
 				return ;
 			},
 			error: function(req, error, errObj) {
 			}
 		});
		
	}
	//发送验证码
	function sendSMS(){
		debugger
			var phoneNumber = $("input[name='phoneNumber']").val();  //电话号码
			if(phoneNumber==null||phoneNumber==""){
				layer.msg("电话号码不能为空");
				return;
			}
			$.ajax({
	 			type: "get",
	 			url: "${ctx}/loginData/sendSmsCheckCode?phoneNumber="+phoneNumber+"&checkCodeType=1",
	 			dataType: "json",
	 			async:false,
	 			contentType: "application/json;charset=utf-8",
	 			success: function(result) {
	 				debugger;
	 				var data = result;
	 				return;
	 			},
	 			error: function(req, error, errObj) {
	 			}
	 		});
		}
	
</script>
</html>